﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;

namespace TorchlightModOverseer.Infrastructure
{
	public class DefaultSerializationService : ISerializerService
	{
		JsonSerializer jsonSerializer = new JsonSerializer();

		public void Serialize(System.IO.TextWriter writer, object value)
		{
			jsonSerializer.Serialize(writer, value);
		}

		public T Deserialize<T>(System.IO.TextReader reader)
		{
			return (T)jsonSerializer.Deserialize(reader, typeof(T));
		}

		public string FileExtension
		{
			get { return ".json"; }
		}

	}
}
